var a = require("../../utils/api.js"), n = getApp();

Page({
    data: {
        info: [],
        now: [],
        page: 1
    },
    onLoad: function(o) {
        var t = this;
        a.GetAllHeadHistory({
            openid: n.globalData.openid,
            page: t.data.page
        }).then(function(a) {
            console.log(a), t.setData({
                info: a.data.data,
                now: a.data.now,
                page: parseInt(a.data.page) + 1
            });
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {
        var o = this;
        a.GetAllHeadHistory({
            openid: n.globalData.openid,
            page: 1
        }).then(function(a) {
            console.log(a), o.setData({
                info: a.data.data,
                now: a.data.now,
                page: parseInt(a.data.page) + 1
            });
        });
    },
    onReachBottom: function(o) {
        var t = this;
        a.GetAllHeadHistory({
            openid: n.globalData.openid,
            page: t.data.page
        }).then(function(a) {
            console.log(a), t.setData({
                info: t.data.info.concat(a.data.data),
                now: a.data.now,
                page: parseInt(a.data.page) + 1
            });
        });
    },
    onShareAppMessage: function() {}
});